package com.kh.pajx.sop.dao.order.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.kh.pajx.sop.base.BaseDaoImpl;
import com.kh.pajx.sop.dao.order.IReplaceCardOrderDetailDao;
import com.kh.pajx.sop.domain.order.ReplaceCardOrderDetail;

/**
 * 补卡单据明细数据持久化操作实现类
 * @author:	azzcsimp
 * @Createdate:	2014年11月11日 上午10:17:15
 */
@Repository
@SuppressWarnings("unchecked")
public class ReplaceCardOrderDeatilDaoImpl extends BaseDaoImpl<ReplaceCardOrderDetail> implements IReplaceCardOrderDetailDao {

	@Override
	public List<ReplaceCardOrderDetail> getDetailByRcoId(String rcoId)
			throws Exception {
		
		return this.getSession().createQuery("FROM ReplaceCardOrderDetail rco where rco.rcoId=?").setString(0, rcoId).list();
	}

	@Override
	public Map<String,String> getStuPhoto(String stuIds) throws Exception {
		String sql ="select stu.stu_id,stu.stu_No from hs_student_info stu where stu.stu_id in "+stuIds;
		//System.out.println(sql);
		Map<String,String> stuPhoto=new HashMap<String,String>();
		List<List<String>> stus = this.getByJdbcSQL(sql);
		for (List<String> list : stus) {
			System.out.println();
			stuPhoto.put(list.get(0), list.get(1));
		}
		return stuPhoto;
	}

	/*@Override
	public List<ReplaceCardOrderDetail> findOrderDetailByRcoId(String rcoId){
		return getSession().createSQLQuery(//
				"FROM ReplaceCardOrderDetail o WHERE o.rcoId =?")//
				.setParameter(0, rcoId)//
				.list();
	}
	
	@Override
	public List<ReplaceCardOrderDetail> findOrderDetailByRcoId(String rcoId, int status){
		return getSession().createSQLQuery(//
				"FROM ReplaceCardOrderDetail o WHERE o.rcodStatus=? AND o.rcoId =?")//
				.setParameter(0, status)//
				.setParameter(1, rcoId)//
				.list();
	}*/
}
